<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>白卡出入库统计</title>

<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" language="javascript" src="../script/common_stat.js"></script>
<script type="text/javascript">

	var dimensions = {"org":{name:"所属机构",option:{"p200":"省大区","p500":"地市"}},"orgLevel":"机构等级"}
	var measures = {"count":"数量"}
	var defaultHorizon = {"org":{"p200":true,"p500":true}}
	var defaultVertical = {"orgLevel":true}
	var defaultMeasure = {"count":true}
	var crossconf = {
		dimensions : dimensions,
		measures : measures,
		defaultMeasure : defaultMeasure,
		defaultVertical : defaultVertical,
		defaultHorizon : defaultHorizon
	}
	
	var pivot;
	
	function load(){
		Eui.showNavigation();
		setPages(["crosstabview","queryView"]);
		
		Common.initDict(statForm.status,"pos_status","全 部");
		pivot = new Pivot("crosstabview","org_stat");		
		pivot.initConf(crossconf)
		pivot.setPivotHead('pivotTitle','机构报表');
		setOrg(Common.cOrg());		
	}
	function doQuery(){
		if(!checkForm(statForm))
			return;
		pivot.setPivotHead('statTime',Format.today(true));
		pivot.setPivotHead('statClass',"无");
		pivot.setPivotHead('beginTime','');
		pivot.setPivotHead('endTime','');
		pivot.param = paramFunc();
		pivot.refresh();
		switchPage("crosstabview");
	}
	
	function paramFunc(){
		var cOrg = Common.cOrg()
		statForm.currentOrg.value = cOrg.id;
		statForm.currentOrgLevel.value = cOrg.orgLevel;
		return Common.getValues(statForm);
	}
	
	//选择单位控件
	function setOrg(sorg) {
		statForm.orgId.value = sorg.id;
		statForm.orgLevel.value = sorg.orgLevel;
		statForm.orgName.value = sorg.name;
	}
	function selOrganization(){
		SystemMgnt.selOrg(setOrg,{rangeLevel:Constants.ORG_LEVEL_CITY})
	}
</script>
</head>

<body onload="load()">
	<div class="nav"><div id="nav">&nbsp;</div></div>
		<!--查询静态页面部分-->
	<div id="queryView" class="form">
		<div class="formTitle">机构统计：查询条件</div>
		<!--查询条件form-->
		<form id = "statForm" name="statForm">
			<input type="hidden" name="orgId"/>
			<input type="hidden" name="orgLevel"/>
			<input type="hidden" name="currentOrg"/>
			<input type="hidden" name="currentOrgLevel"/>
			<table cellSpacing=0 cellPadding=4 width="100%" border=0 class="col3 label4">
				<tr>
					<td>
						<label>所属机构</label>
						<input type="text" name="orgName" class="readonly" maxlength="20">
						<a class="orga" title="选择所属机构" href="javascript:void(0)" onclick="selOrganization()">&nbsp;&nbsp;</a>
					</td>
					<td><button type="button" onclick="doQuery()">查 询</button></td>
				</tr>
			</table>
		</form>
	</div>
	<div id="crosstabview" style="display:none;"></div>
</body>

</html>
